package com.elrichuang.webedge.client;

import com.elrichuang.terminator.tri.user.UserReply;
import com.elrichuang.terminator.tri.user.UserRequest;
import com.elrichuang.terminator.tri.user.UserServer;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

@Service
public class UserClient {
    @DubboReference
    private UserServer userServer;

    public String sayHello(String name) {
        UserRequest userRequest = UserRequest.newBuilder().setName(name).build();
        UserReply reply = userServer.sayHello(userRequest);

        return reply.getMessage();
    }
}
